import Vue from 'vue'
import VueRouter from 'vue-router'




Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/user',
    name: 'user',
    component: () => import('../pages/user/user.vue')
  },
  {
    path: '/',
    name: 'login',
    component: () => import('../pages/login/login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../pages/login/register.vue')
  },
  {
    path: '/addOrder',
    name: 'addOrder',
    component: () => import('../pages/order/address.vue')
  },
  {
    path: '/addUserInfo',
    name: 'addUserInfo',
    component: () => import('../pages/login/addUserInfo.vue')
  },

  {
    path: '/showIsOnShaves',
    name: 'showIsOnShaves',
    component: () => import('../pages/manager/showIsOnShaves.vue')
  },
  {
    path: '/addUserOrder',
    name: 'addUserOrder',
    component: () => import('../pages/order/addUserOrder.vue')
  },
  {
    path: '/UserOrder',
    name: 'UserOrder',
    component: () => import('../pages/order/UserOrder.vue')
  },
  {
    path: '/ShopCar',
    name: 'ShopCar',
    component: () => import('../pages/shopcar/ShopCar.vue')
  },
  {
    path: '/deposit',
    name: 'deposit',
    component: () => import('../pages/deposit/deposit.vue')
  },
  {
    path: '/depositDetail',
    name: 'depositDetail',
    component: () => import('../pages/deposit/depositDetail.vue')
  },
  {
    path: '/addGoodsAddress',
    name: 'addGoodsAddress',
    component: () => import('../pages/getgoods/addGoodsAddress.vue')
  },
  {
    path: '/getGoodsAddress',
    name: 'getGoodsAddress',
    component: () => import('../pages/getgoods/getGoodsAddress.vue')
  },
  {
    path: '/updateGoodsAddress',
    name: 'updateGoodsAddress',
    component: () => import('../pages/getgoods/updateGoodsAddress.vue')
  },
  {
    path: '/ShopIndex',
    name: 'ShopIndex',
    component: () => import('../pages/goods/ShopIndex')
  },
  {
    path: '/ShopIndexDetail',
    name: 'ShopIndexDetail',
    component: () => import('../pages/goods/ShopIndexDetail.vue')
  },
  {
    path: '/messageimg',
    name: 'messageimg',
    component: () => import('../pages/zhuzhuang/messageimg.vue')
  },
 
  
 
]

const router = new VueRouter({
  routes
})

export default router
